package cn.tedu.front.details.startrun;

import cn.tedu.front.details.dao.cache.ICityCacheRepository;
import cn.tedu.front.details.dao.persest.repository.CityRepository;
import cn.tedu.front.details.pojo.vo.CityVO;
import cn.tedu.front.details.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CityRunner implements ApplicationRunner {
    @Autowired
    private CityService cityService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("通过缓存预热将省市区的数据加入到redis中...");
        cityService.rebuildCache();
    }


}
